var topo = {
	view:"toolbar",
	paddingY:1,
	height:40,
	elements:[
		{ view:"label", label:"Nome da Empresa" },
		{ view: "button", type: "icon", icon:"cog", label:"Admin", width: 100},
	]
};

var nav = {
	container:"nav",
	view: "menu",
	css:"menu",
	layout: "y",
	width:200,
	template:"#value#",
	select: "true",
	data:"itensMenu",
	on:{ 
		onItemClick:function(id){
			switch(id){
				case "m_home":
						changePagina("home");			
					break;
				case "m_cad":
						changePagina("cadastro")
					break;
				case "cons":

					break;
			}

		}
	}
};

// --- Area do corpo ----------------------------------------

var home = {
	id:"home",
	template: "http->home.html"
}

var cadastro = {
	hidden:true,
	id:"cadastro",
	type: "clean",
	rows:[
		{ template: "http-> cadastro.html"},
		{ template: "ola"}
	]
}

var pagina = {
	container:"content",
	css:"cont",
	minHeight:550,
	rows:[home, cadastro]
};

var outspace = {
	width: 60
}

var corpo = {
	cols:[ nav, pagina, outspace ]
};

//-------------------------------------------------------------

var rodape = {
	css:"rodape",
	template:"html->rodape"
};

var itensMenu = [
{ id: "m_home", value: "Home" },
{ id: "m_cad", value: "Cadastro" },
{ id: "m_cons", value: "Consulta" },
{ id: "m_log", value: "Log" },
{ id: "m_doc", value: "Documentação" }
];

//--- FUNCOES ----------------------------------
function hello(){
	alert("ola mundo");
}


function changePagina(pag){
	$$("cadastro").hide()
	$$("home").hide()
	
	$$(pag).show()
}
